﻿@model GPS.ENTITYS.CrudModelFORMDKH


<style type="text/css">
    .btn-file {
        position: relative;
        overflow: hidden;
    }

        .btn-file input[type=file] {
            position: absolute;
            top: 0;
            right: 0;
            min-width: 100%;
            min-height: 100%;
            font-size: 100px;
            text-align: right;
            filter: alpha(opacity=0);
            opacity: 0;
            background: red;
            cursor: inherit;
            display: block;
        }

    input[readonly] {
        background-color: white !important;
        cursor: text !important;
    }
</style>
<div class="modal-header fdb-panel-header-10">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h5 class="modal-title" id="myModalLabel">Chi tiết Thông Tin Khóa Học</h5>
</div>
<div class="modal-body fdb-panel-body-0">
    <div id="tabs">
        @using (Html.BeginForm("Detail", "GPS_KhoaHoc", FormMethod.Post, new { enctype = "multipart/form-data", id = "form" }))
        {
            @Html.AntiForgeryToken()
            @Html.ValidationSummary(true)
            @Html.HiddenFor(m => m.KH_MA)
            <div id="tabs-1">
                <fieldset class="fs_body">
                    <legend class="head_title">Thông tin Khóa học</legend>
                    <div class="row margin-top-05">
                        <div class="col-lg-6">
                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Mã khóa Học:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_MA, new { @class = "form-control", @readonly = "readonly", @id = "txtKH_MA" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Đơn vị GTVT:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_DVGTVT_MA, new { @class = "form-control", @readonly = "readonly", @id = "txtKH_MA" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Tên khóa Học:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_TEN, new { @class = "form-control", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Hạng GPLX:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_HANGGPLX_MA, new { @class = "form-control", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Hạng đào tạo:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_HANGDT_MA, new { @class = "form-control", @readonly = "readonly" })
                                </div>
                            </div>


                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Số QĐ khai giảng:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_SOQDKG, new { @class = "form-control", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label" style="text-align: inherit;">
                                    Ngày QĐ khai giảng:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_NGAYQDKG, "{0:dd/MM/yyyy}", new { @class = "form-control", @style = "width:120px", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Ngày khai giảng:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_NGAYKG, "{0:dd/MM/yyyy}", new { @class = "form-control", @style = "width:120px", @readonly = "readonly" })
                                </div>
                            </div>


                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Ngày bế giảng:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_NGAYBG, "{0:dd/MM/yyyy}", new { @class = "form-control", @style = "width:120px", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Ngày Thi:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_NGAYTHI, "{0:dd/MM/yyyy}", new { @class = "form-control", @style = "width:120px", @readonly = "readonly" })
                                </div>
                            </div>




                        </div>

                        <div class="col-lg-6">
                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Ngày sát hạch:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_NGAYSH, "{0:dd/MM/yyyy}", new { @class = "form-control", @style = "width:120px", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Tổng học viên:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_TONGHV, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Học viên tốt nghiệp:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_SOHVTOTNGHIEP, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Học viên cấp phép:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_SOHVDUOCCAPGPLX, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Thời gian đào tạo:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_THOIGIANDT, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Số ngày ôn kt:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_SONGAYONKIEMTRA, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Số ngày thực học:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_SONGAYTHUCHOC, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Số ngày nghỉ lễ:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_SONGAYNGHILE, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Tổng số ngày:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_TONGSONGAY, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            <div class="row margin-top-05">
                                <div class="col-md-4 control-label">
                                    Tiến trình:
                                </div>
                                <div class="col-md-8">
                                    @Html.DisplayFor(model => model.KH_TTXL_MA, new { @class = "form-control", @type = "number", @readonly = "readonly" })
                                </div>
                            </div>

                            @*<div class="row margin-top-05">
                                    <div class="col-md-4 control-label">
                                        Trạng Thái:
                                    </div>
                                    <div class="col-md-8">
                                        @Html.DisplayFor(model => model.KH_ACTIVE, new { @readonly = "readonly" })
                                    </div>
                                </div>*@
                        </div>
                    </div>

                    <div class="row">
                        <div class="row margin-top-05">
                            <div class="col-md-2 control-label">
                                Mục tiêu đào tạo:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.KH_MUCTIEUDT, new { @class = "form-group", @rows = 5, @style = "width:100%;max-width:100%;", @readonly = "readonly" })
                            </div>
                        </div>

                        <div class="row margin-top-05">
                            <div class="col-md-2 control-label">
                                Mô tả:
                            </div>
                            <div class="col-md-8">
                                @Html.DisplayFor(model => model.KH_MOTA, new { @class = "form-group", @rows = 5, @style = "width:100%;max-width:100%;", @readonly = "readonly" })
                            </div>
                        </div>
                    </div>
                </fieldset>
                <div class="row margin-top-05 Action_FormDetail">
                    <div class="col-md-12">
                        <a href="@Url.Action("ExportWord", "GPS_KhoaHoc", new { id = Model.KH_MA, id1 = Model.KH_DVGTVT_MA })" class="btn btn-primary btn-sm">
                            <i class="fa fa-file-excel-o"></i> In chi tiết thông tin khóa học
                        </a>
                        &nbsp;&nbsp;
                        <button class="btn btn-primary btn-sm" type="button" data-dismiss="modal">Hủy bỏ</button>
                    </div>
                </div>
            </div>
        }
    </div>
</div>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>

<script src="~/Scripts/datepicker.js"></script>
<script src="~/Scripts/jquery-ui-1.11.4.js"></script>
<script src="~/Scripts/jquery.maskedinput.js"></script>
<script src="~/Scripts/jquery.maskMoney.js"></script>
<script src="~/Scripts/jquery.number.js"></script>
<script src="~/Scripts/jquery.masknumber.js"></script>
<script src="~/Scripts/moment.js"></script>

<script type="text/javascript">

    // Voi jQuery 1.9 > thi chi validate gia tri trong active tab
    // Muon validate nhung gia tri trong cac tab khac nua thi dung jquery.validate 1.8.1 or 1.7


    // mask edit cho truong ngay thang (su dung jquery.maskedinput)


    function ToJavaScriptDate(value) {
        if (value != null) {
            var pattern = /Date\(([^)]+)\)/;
            var results = pattern.exec(value);
            var dt = new Date(parseFloat(results[1]));
            return dt.getDate() + "/" + (dt.getMonth() + 1) + "/" + dt.getFullYear();
        }
        return null;
    }
</script>

<script type='text/javascript'>
    $(document).on('change', '.btn-file :file', function () {
        var input = $(this),
            numFiles = input.get(0).files ? input.get(0).files.length : 1,
            label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
        input.trigger('fileselect', [numFiles, label]);
    });

    function preview_image(event) {
        var reader = new FileReader();
        reader.onload = function () {
            var output = document.getElementById('output_image');
            output.src = reader.result;
        }
        reader.readAsDataURL(event.target.files[0]);
    }
</script>

<script type="text/javascript">
    $("#KH_NGAYQDKG").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });

    $("#KH_NGAYKG").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });

    $("#KH_NGAYBD").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });

    $("#KH_NGAYKT").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });

    $("#KH_NGAYTHI").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });

    $("#KH_NGAYSH").datepicker({
        changeMonth: true,
        changeYear: true,

        dateFormat: 'dd/mm/yy'
    });

    $("#KH_NGAYQDKG").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    $("#KH_NGAYKG").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    $("#KH_NGAYBD").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    $("#KH_NGAYKT").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    $("#KH_NGAYTHI").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });
    $("#KH_NGAYSH").mask("99/99/9999", { placeholder: "dd/mm/yyyy" });

    // cho phep nhap so thap phan (su dung jquery.number)
    //$("#GV_THAMNIENLX").number(true, 2, '.', '');

</script>

@Styles.Render("~/Content/themes/base/css")

<script type="text/javascript">
    $(document).ready(function () {
        $('.btn-file :file').on('fileselect', function (event, numFiles, label) {

            var input = $(this).parents('.input-group').find(':text'),
                log = numFiles > 1 ? numFiles + ' files selected' : label;

            if (input.length) {
                input.val(log);
            } else {
                if (log) alert(log);
            }

        });


    })
</script>
